Field of the Invention
The present invention relates to a printing apparatus for printing an image on a sheet, a method for controlling a printing apparatus, and a storage medium.
Description of the Related Art
A method for reading a document includes two methods, namely an optical system movement method and a skimming-through method. In the optical system movement method, a document is placed on platen glass (a document platen), and the document in the fixed position is read while an optical system is moved. There is known a technique for, in a case where a document is read by the optical system movement method, shortening time until image data generated by reading a document of a first page is output to a sheet (referred to as “first copy out time (FCOT)”). On the other hand, in the skimming-through method, a document is placed on a document tray, and the document is read at the position of a fixed optical system while the document is conveyed by an automatic document feeder (ADF).
A multifunction peripheral discussed in the publication of Japanese Patent Application Laid-Open No. 2015-5950 writes image data generated by reading the document to an image memory without compressing the image data when a first page of a document is conveyed by an ADF. Then, before the writing of the image data for a single page to the image memory is finished, the multifunction peripheral starts the reading of the image data for a single page from the image memory and performs printing based on the image data read from the image memory. On the other hand, when a second page or later of a document conveyed by the ADF is conveyed, the multifunction peripheral compresses image data generated by reading the document and writes code data to the image memory. Then, the multifunction peripheral saves in a hard disk drive (HDD) the code data written to the image memory, then reads the code data saved in the HDD, decompresses the code data, and performs printing based on the decompressed image data.
When the copying of a document is executed, if image data generated by reading the document is stored in a first storage unit such as an image memory, then, image data read from the first storage unit is stored in a second storage unit such as an HDD, it takes time to perform the processing. Thus, in the copying of the document, it is more desirable to execute printing based on the image data of the document stored in the first storage unit than to execute printing based on the image data of the document stored in the second storage unit, in terms of the shortening of the processing time.
Meanwhile, when the copying of a plurality of pages is executed, if all image data of documents of the plurality of pages is stored in a first storage unit such as an image memory, and an attempt is made to execute the printing based on image data of documents stored in the first storage unit, an overflow occurs in the first storage unit. This is because the speed of writing image data to the first storage unit through reading from documents is faster than the speed of reading image data from the first storage unit to carry out the printing.